package com.jarvis.hospital.prescription.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jarvis.hospital.R;
import com.jarvis.hospital.prescription.model.CFIntervalModel;
import com.jarvis.hospital.prescription.model.MedicineBasicModel;

import java.util.List;

/**
 * Created by jarvis.liu on 9/12/2016.
 */
public class MedicineBasicAdapter extends BaseQuickAdapter<MedicineBasicModel> {


    public MedicineBasicAdapter(int layoutResId, List<MedicineBasicModel> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, MedicineBasicModel medicineBasicModel) {
        TextView tv_name = baseViewHolder.getView(R.id.tv_name);
        tv_name.setText(medicineBasicModel.getMedicineName());

        if (medicineBasicModel.isSelect()) {
            tv_name.setTextColor(mContext.getResources().getColor(R.color.blue_nomal));
        } else {
            tv_name.setTextColor(mContext.getResources().getColor(R.color.black));
        }
    }
}
